<!--# layout("/common/layout.html",{"jsBase":"/js/enrollItem/enrollItem/"}){ -->

<form class="layui-form layui-form-pane" id="addForm"  lay-filter="editform">
    <input type="hidden" name="planId" id="planId">

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">省份</label>
                <div class="layui-input-inline">
                    <layui:simpleDataSelect name="provinceId" value="18" data="${provinceList}"
                                            attrId="provId" attrName="provName" laySearch="true"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">大学或专业</label>
                <div class="layui-input-inline">
                    <select name="type" lay-verify="">
                        <option value="0">大学</option>
                        <option value="1">专业</option>
                    </select>
                </div>
            </div>

        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">文理科</label>
                <div class="layui-input-inline">
                    <select name="majorTypeId" lay-verify="">
                        <option value="1">文科</option>
                        <option value="2">理科</option>
                        <option value="3">综合</option>
                    </select>
                </div>
            </div>

            <div class="layui-inline">
            <label class="layui-form-label">分数段</label>
				<div class="layui-input-inline">
                         <input type="text" name="scoreSegment" id="scoreSegment" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>

        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">大学名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="univName" id="univName" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">大学代码</label>
                <div class="layui-input-inline">
                    <input type="text" name="univCode" id="univCode" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">专业名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="majorName" id="majorName" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">专业代码</label>
                <div class="layui-input-inline">
                    <input type="text" name="majorCode" id="majorCode" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>

        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">录取人数</label>
                <div class="layui-input-inline">
                    <input type="text" name="enroll" id="enroll" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
            <div class="layui-inline">
            <label class="layui-form-label">选科要求</label>
				<div class="layui-input-inline">
                                <input type="text" name="courseName" id="courseName" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>

        </div>
    </div>

    <div class="layui-row">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">最低分</label>
                <div class="layui-input-inline">
                    <input type="text" name="lowScore" id="lowScore" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">最低分排名</label>
                <div class="layui-input-inline">
                    <input type="text" name="lowScoreRank" id="lowScoreRank" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>

        </div>
    </div>


    <div class="layui-row">
        <div class="layui-form-item">

            <div class="layui-inline">
            <label class="layui-form-label">平均分</label>
				<div class="layui-input-inline">
                                <input type="text" name="averScore" id="averScore" autocomplete="off" maxlength="50" class="layui-input" >
				</div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">学制</label>
                <div class="layui-input-inline">
                    <input type="text" name="schoolYear" id="schoolYear" autocomplete="off" maxlength="50" class="layui-input" >
                </div>
            </div>
        </div>
    </div>








    <layui:submitButtons id="addButton" />
</form>
<!--#} -->
<script>
layui.extend({
    loading: '../../../plugins/layui_extends/loading/loading',
}).define([ 'form', 'laydate', 'table','loading','enrollItemApi'], function(exports) {
    var form = layui.form;
    var enrollItemApi = layui.enrollItemApi;
    var index = layui.index;
    var isNew = true;
    <!--# if(!(isEmpty(enrollItemJson))){  -->
    isNew = false;
    <!--# } -->
    var view = {
        init:function(){
            Lib.initGenrealForm($("#addForm"),form);
            this.initSubmit();
        },
        initSubmit:function(){
            $("#addButton").click(function(){
                // $("#addButton").hide();
                // $("#addButton-loading").show();
                // $("#addButton-loading").loading();
                form.on('submit(form)', function(){
                    enrollItemApi.saveForm(isNew,$('#addForm'),function(){
                        parent.window.dataReload();
                        Common.info("保存成功");
                        Lib.closeFrame();
                    });
                });
            });

            $("#addButton-cancel").click(function(){
                Lib.closeFrame();
            });
        }

    }
    view.init();
    <!--# if(!(isEmpty(enrollItemJson))){  -->
    var formJson = ${enrollItemJson};
    form.val("editform",formJson);
    <!--# } -->
});
</script>
